package my.design.test.Interpreter;

/**
 * @author zp
 * @version 1.0
 * @description: 终结解析节点
 * @date 2022/10/30 15:29
 */
public class TerminalExpression implements Expression{
    private String data;

    public TerminalExpression(String data) {
        this.data = data;
    }

    @Override
    public boolean interpret(String context) {
        return context.contains(data);
    }
}
